/*
	Flie:						LoadState.h
	Course:				SGP 1208
	Author:				Kori Po
	Purpose:				Loading a saved game
*/

#pragma once
#include "IState.h"

// SGD Wrappers
#include "../SGD Wrappers/CSGD_Direct3D.h"
#include "../SGD Wrappers/CSGD_DirectInput.h"
#include "../SGD Wrappers/CSGD_TextureManager.h"
#include "../SGD Wrappers/CSGD_XAudio2.h"
#include "../SGD Wrappers/SGD_String.h"

#include "TempFont.h"

#define TEXTBOXITEMS 3
#define LOADMENUITEMS 4

#include "Player.h"

class CLoadState : public IState
{
private:
	CLoadState(void);
	virtual ~CLoadState(void);

	// Wrapper Pointers
	CSGD_Direct3D*						m_3DGuy;
	CSGD_DirectInput*					m_InputGuy;
	CSGD_TextureManager*		m_TextureGuy;
	CSGD_XAudio2*							m_AudioGuy;

	// Asset IDs
	int							m_nMenuWizardID;
	int							m_nBackGroundID;
	int							m_nOptionsBoxID;
	int							m_nTextBoxID;

	// Menu DMs
	int			m_nSelectedItem;
	bool		m_MenuSelection[LOADMENUITEMS];
	char*		m_szMenuItem[LOADMENUITEMS];
	RECT		m_MenuRect[LOADMENUITEMS];

	// Helper DM
	bool m_bHasGame[TEXTBOXITEMS];

	// Font DMs
	CTempFont*		m_MenuFont;	

	// Helper Function
	bool	GrabSavedGameA();
	bool	GrabSavedGameB();
	bool	GrabSavedGameC();
	void	 Mouseinthebox();

	int		SaveWorldA;
	int		SaveLevelA;

	CPlayer* m_pAGuy;
	CPlayer* m_pBGuy;
	CPlayer* m_pCGuy;

	int*	m_pGetIt;

public:
	// SINGLETON
	static CLoadState* GetInstance( void );

	// EnE Functions
	virtual void Enter(void);			//Load Resources
	virtual void Exit(void);				//Unload Resources
	
	// Running Functions
	virtual bool Input(void);			//Handle user input
	virtual void Update(float fElapsedTime);		//Update game tokens
	virtual void Render(void) ;		//Render game tokens

	CPlayer* GetAGuy() {return m_pAGuy;};
	CPlayer* GetBGuy() {return m_pBGuy;};
	CPlayer* GetCGuy() {return m_pCGuy;};

	int*			GetThis() {return m_pGetIt;};

};

